package com.androidified.personalshopper.ui;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputType;
import android.text.method.PasswordTransformationMethod;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.LinearLayout;

import com.androidified.personalshopper.R;

public class ProfileActivity extends Activity {

	public static final String EXTRA_PROMO_ID = "promoId";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		getActionBar().setDisplayShowHomeEnabled(false);
		View view = getLayoutInflater()
				.inflate(R.layout.profile_activity, null);
		view.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				AlertDialog.Builder editalert = new AlertDialog.Builder(ProfileActivity.this, AlertDialog.THEME_HOLO_DARK);

				editalert.setTitle(R.string.enter_pin_title);
				editalert.setMessage(R.string.enter_pin_message);

				final EditText input = new EditText(ProfileActivity.this);
				input.setInputType(InputType.TYPE_CLASS_NUMBER);
				input.setHint(R.string.type_here_your_pin);
				input.setTransformationMethod(PasswordTransformationMethod.getInstance());
				LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
						LinearLayout.LayoutParams.MATCH_PARENT,
						LinearLayout.LayoutParams.MATCH_PARENT);
				input.setLayoutParams(lp);
				editalert.setView(input);

				editalert.setPositiveButton(R.string.ok,
					new DialogInterface.OnClickListener() {
						public void onClick(DialogInterface dialog, int whichButton) {
							startActivity(new Intent(ProfileActivity.this,AccountsActivity.class));
						}
					});

				editalert.show();
			}
		});
		setContentView(view);
	}

}
